package com.jinmdz.fmis.common.model;

import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;

/**
 * Poi.Header
 *
 * @author LiCongLu
 * @date 2020-01-03 15:38
 */
public class PoiTitle extends PoiCell {

    /**
     * 单元格样式
     */
    private XSSFCellStyle style;

    /**
     * 单元格合并范围
     */
    private CellRangeAddress rangeAddress;

    public XSSFCellStyle getStyle() {
        return style;
    }

    public PoiTitle setStyle(XSSFCellStyle style) {
        this.style = style;
        return this;
    }

    public CellRangeAddress getRangeAddress() {
        return rangeAddress;
    }

    public PoiTitle setRangeAddress(CellRangeAddress rangeAddress) {
        this.rangeAddress = rangeAddress;
        return this;
    }

    /**
     * 设置合并范围
     *
     * @param firstRow
     * @param lastRow
     * @param firstCol
     * @param lastCol
     * @return
     */
    public PoiTitle setCellRangeAddress(int firstRow, int lastRow, int firstCol, int lastCol) {
        this.rangeAddress = new CellRangeAddress(firstRow, lastRow, firstCol, lastCol);
        return this;
    }

}
